﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BPM.Entity
{
    /// <summary>
    /// 一次产品组装中一个物料的使用情况
    /// </summary>
    public class ProductAssembleItem : BaseEntity
    {
		public ProductAssembleItem()
		{
			this._ProductAssemble = this.CreateReference<ProductAssemble>();
			this._MaterialDefinition = this.CreateReference<MaterialDefinition>();
		}

		private ILazyEntityRef<ProductAssemble> _ProductAssemble;
		/// <summary>
        /// 所属的产品组装
        /// </summary>
		public ProductAssemble ProductAssemble
		{
			get
			{
				return this._ProductAssemble.Entity;
			}
			set
			{
				this._ProductAssemble.Entity = value;
			}
		}
        /// <summary>
        /// 产品组装Id
        /// </summary>
		public int ProductAssembleId
		{
			get
			{
				return this._ProductAssemble.Id;
			}
			set
			{
				this._ProductAssemble.Id = value;
			}
		}

		private ILazyEntityRef<MaterialDefinition> _MaterialDefinition;
		/// <summary>
        /// 用到的物料
        /// </summary>
		public MaterialDefinition MaterialDefinition
		{
			get
			{
				return this._MaterialDefinition.Entity;
			}
			set
			{
				this._MaterialDefinition.Entity = value;
			}
		}
        /// <summary>
        /// 用到的物料的Id
        /// </summary>
		public int MaterialDefinitionId
		{
			get
			{
				return this._MaterialDefinition.Id;
			}
			set
			{
				this._MaterialDefinition.Id = value;
			}
		}

        /// <summary>
        /// 物料使用的数量
        /// </summary>
        public int Amount { get; set; }
    }
}
